//
//  HomeDetilViewController.m
//  BProject
//
//  Created by 吴涛 on 15/8/17.
//  Copyright (c) 2015年 久远的回忆. All rights reserved.
//

#import "HomeDetilViewController.h"
#import "PKRequestManager.h"
@interface HomeDetilViewController ()
@property (nonatomic, strong) NSString *urlStr;
@property (nonatomic, strong) UIWebView *mainWeb;
@end

@implementation HomeDetilViewController

- (void)setModel:(HomeModel *)model
{
    _model = model;
    _urlStr = model.post[@"id"];
}


//- (void)parserData{
//    
//    
//    NSLog(@"%@",_urlStr);
//    [PKRequestManager manager:GET requestWith:[NSString stringWithFormat:@"http://app.qdaily.com/app/articles/detail/%@.json",_urlStr] parDic:nil finish:^(NSData *data) {
//        
//        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves | NSJSONReadingMutableContainers error:nil];
//        
//        
//       [_mainWeb loadHTMLString:dic[@"response"][@"article"][@"body"] baseURL:;
//        
//        
//    } error:^(NSError *error) {
//        
//    }];
//}


- (void)viewDidLoad {
    
    _mainWeb = [[UIWebView alloc]initWithFrame:self.view.bounds];
    
    
    [self.view addSubview:_mainWeb];
    
    [_mainWeb loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:_model.post[@"appview"]]]];
    
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
